%ifndef BOOT_REALMODEUTILITY_GETCURSORPOSITION
%define BOOT_REALMODEUTILITY_GETCURSORPOSITION
; GetCursorPosition(unsigned short page_number, unsigned short* position)
; @param page_number 低字节保存显示屏页号，高字节用于对齐
; @param position 指向的内存空间保存指针位置
bits 16
Boot.RealModeUtility.GetCursorPosition:
Boot.RealModeUtility.GetCursorPosition.Initialize:
    pusha
    mov bp, sp
    mov ah, 0x03
    mov bh, [bp + 18] ; 页号
Boot.RealModeUtility.GetCursorPosition.Get:
    int 0x10
    mov bx, [bp + 20] ; bx = position
    mov [bx], dx ; *bx = dx（dx 中存放指针位置）
Boot.RealModeUtility.GetCursorPosition.Return:
    popa
    ret
%endif